package com.example.a2032.db.dao;

import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;

import com.example.a2032.entity.ImResultData;

import java.util.List;

@Dao
public interface GroupsDao {

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void insert(ImResultData.GroupsBean groupsBean);

    @Query("select * from groupsbean")
    LiveData<List<ImResultData.GroupsBean>> loadAllGroups();

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    List<Long> insert(List<ImResultData.GroupsBean> groups);

    @Query("select * from groupsbean where im==:id")
    ImResultData.GroupsBean findGroup(String id);

    @Query("Delete from groupsbean")
    void deleteAllGroup();
}
